/*
 * $Id: ResCloser.h,v 1.1 2005-05-20 09:34:04 bacon Exp $
 */

#ifndef _XPP_BAS_RESCLOSER_CLASS_
#define _XPP_BAS_RESCLOSER_CLASS_

#include <xpp/Uncopyable.h>

namespace xpp
{
	namespace bas
	{
	
		class ResCloser: public Uncopyable
		{
		public:
			typedef void (*closer_t) (void*);

			ResCloser (closer_t func, void* arg): func(func), arg(arg) {}
			~ResCloser ()
			{
				func (arg);
			}

		protected:
			closer_t func;
			void*  arg;
		};

	}
}

#endif
